package TutorielChevalier;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * Write a description of class Sorcier here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Sorcier
{
	// instance variables - replace the example below with your own
	private String nom;
	private int x;
	private List<Chevalier> chevaliers = new ArrayList<Chevalier>();

	/**
	 * Constructor for objects of class Sorcier
	 */
	public Sorcier()
	{
		// initialise instance variables
		x = 0;
	}
	
	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public void addChevalier(Chevalier c)
	{
		if(c != null && !chevaliers.contains(c))
			chevaliers.add(c);
	}

	public void soigner()
	{
		for(Chevalier c : chevaliers)
			c.setVie(c.getVie() + 10);
	}
	
	public List getChevaliers()
	{
		return chevaliers;
	}

	/**
	 * An example of a method - replace this comment with your own
	 * 
	 * @param  y   a sample parameter for a method
	 * @return     the sum of x and y 
	 */
	public int sampleMethod(int y)
	{
		// put your code here
		return x + y;
	}
}
